{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}


{% block title %}项目指标关系表{% endblock %}


{% block page_content %}

<div class="form-group col-md-2">
    <select class="form-control" id="select_project" name="select_project" onchange="window.document.location.href='/web_day_index_info?date={{ date }}&project_id='+this.options[this.selectedIndex].value;">
        <option value="">--检查项目--</option>
        {% if project_data %}
            {% for project in project_data%}
              <option value="{{ project.get('id') }}">{{ project.get('name') }}</option>
            {% endfor %}
        {% endif %}
    </select>
</div>

<br><br>
<table class="table table-bordered">
        <tr>
            <th>检查指标名称</th>
            <th>结果</th>
            <th>参考区间</th>
            <th>单位</th>
            <th>实验方法</th>
        </tr>
        {% if project_index__json_data %}
            {% for foo in project_index__json_data %}
            <tr>
                    <td>{{ foo.get('index_name') }}</td>

                    {% if foo.get('value') %}
                        {% if foo.get('value').get('is_abnormal') %}
                            <td bgcolor="#FF0000">{{ foo.get('value').get('value') }}</td>
                        {% else %}
                            <td>{{ foo.get('value').get('value') }}</td>
                        {% endif %}
                    {% else %}
                        <td></td>
                    {% endif %}

                    <td>{{ foo.get('reference_range') }}</td>
                    <td>{{ foo.get('unit_name') }}</td>
                    <td>{{ foo.get('method_name') }}</td>

            </tr>
            {% endfor %}
        {% endif %}
</table>

{% endblock %}
